home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
drawfram
/
drawfram.frm
< prev
next >
Wrap
Text File
|
1995-05-07
|
15KB
|
509 lines
VERSION 2.00
Begin Form Form1
AutoRedraw = -1 'True
BackColor = &H00C0C0C0&
Caption = "DrawFrameOn"
ClientHeight = 3390
ClientLeft = 105
ClientTop = 1710
ClientWidth = 6645
Height = 4080
Icon = 0
Left = 45
LinkTopic = "Form1"
ScaleHeight = 3390
ScaleWidth = 6645
Top = 1080
Width = 6765
Begin TextBox Text1
BackColor = &H00C0C0C0&
BorderStyle = 0 'None
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 8.25
FontStrikethru = 0 'False
FontUnderline = 0 'False
ForeColor = &H00000000&
Height = 705
Left = 1380
MultiLine = -1 'True
TabIndex = 7
Text = "Text1"
Top = 2310
Width = 4065
End
Begin PictureBox Picture7
AutoSize = -1 'True
BackColor = &H00C0C0C0&
BorderStyle = 0 'None
Height = 480
Left = 4830
Picture = DRAWFRAM.FRX:0000
ScaleHeight = 480
ScaleWidth = 480
TabIndex = 6
Top = 1350
Width = 480
End
Begin PictureBox Picture5
AutoSize = -1 'True
BackColor = &H00C0C0C0&
BorderStyle = 0 'None
Height = 480
Left = 3600
Picture = DRAWFRAM.FRX:0302
ScaleHeight = 480
ScaleWidth = 480
TabIndex = 5
Top = 1350
Width = 480
End
Begin PictureBox Picture6
AutoSize = -1 'True
BackColor = &H00C0C0C0&
BorderStyle = 0 'None
Height = 480
Left = 4215
Picture = DRAWFRAM.FRX:0604
ScaleHeight = 480
ScaleWidth = 480
TabIndex = 0
Top = 1350
Width = 480
End
Begin PictureBox Picture4
AutoSize = -1 'True
BackColor = &H00C0C0C0&
BorderStyle = 0 'None
Height = 480
Left = 2985
Picture = DRAWFRAM.FRX:0906
ScaleHeight = 480
ScaleWidth = 480
TabIndex = 4
Top = 1350
Width = 480
End
Begin PictureBox Picture3
AutoSize = -1 'True
BackColor = &H00C0C0C0&
BorderStyle = 0 'None
Height = 480
Left = 2370
Picture = DRAWFRAM.FRX:0C08
ScaleHeight = 480
ScaleWidth = 480
TabIndex = 3
Top = 1350
Width = 480
End
Begin PictureBox Picture2
AutoSize = -1 'True
BackColor = &H00C0C0C0&
BorderStyle = 0 'None
Height = 480
Left = 1740
Picture = DRAWFRAM.FRX:0F0A
ScaleHeight = 480
ScaleWidth = 480
TabIndex = 2
Top = 1350
Width = 480
End
Begin PictureBox Picture1
AutoSize = -1 'True
BackColor = &H00C0C0C0&
BorderStyle = 0 'None
Height = 480
Left = 1125
Picture = DRAWFRAM.FRX:120C
ScaleHeight = 480
ScaleWidth = 480
TabIndex = 1
Top = 1350
Width = 480
End
Begin Label Label2
BackColor = &H00C0C0C0&
Caption = "Label2"
Height = 285
Left = 2490
TabIndex = 9
Top = 810
Width = 2355
End
Begin Label Label1
BackColor = &H00C0C0C0&
Caption = "Label1"
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 8.25
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 465
Left = 240
TabIndex = 8
Top = 120
Width = 6195
End
Begin Menu menuBar
Caption = "Color"
Index = 0
Begin Menu menuColor
Caption = "Black"
Index = 0
End
Begin Menu menuColor
Caption = "Dark Blue"
Index = 1
End
Begin Menu menuColor
Caption = "Dark Green"
Index = 2
End
Begin Menu menuColor
Caption = "Dark Cyan"
Index = 3
End
Begin Menu menuColor
Caption = "Dark Red"
Index = 4
End
Begin Menu menuColor
Caption = "Dark Purple"
Index = 5
End
Begin Menu menuColor
Caption = "Dark Yellow"
Index = 6
End
Begin Menu menuColor
Caption = "Light Gray"
Index = 7
End
Begin Menu menuColor
Caption = "Dark Gray"
Index = 8
End
Begin Menu menuColor
Caption = "Bright Blue"
Index = 9
End
Begin Menu menuColor
Caption = "Bright Green"
Index = 10
End
Begin Menu menuColor
Caption = "Bright Cyan"
Index = 11
End
Begin Menu menuColor
Caption = "Bright Red"
Index = 12
End
Begin Menu menuColor
Caption = "Bright Purple"
Index = 13
End
Begin Menu menuColor
Caption = "Bright Yellow"
Index = 14
End
Begin Menu menuColor
Caption = "Bright White"
Index = 15
End
End
Begin Menu menuBar
Caption = "Exit"
Index = 1
End
End
Option Explicit
Dim Distance As Integer
Dim Color As Integer
Dim Pict As Integer
Dim Msg As String
Sub DrawFrameOn (TopLeftControl As Control, BottomRightControl As Control, Style As String, FrameOffset As Integer, Color As Integer)
' This program has Option Explicit set in the General Declarations
' section so every variable has to be explicitly declared before it
' is referenced.
'
Dim SaveDrawWidth, SaveFillStyle, SaveScaleMode
Dim Offset, TWIPS As Integer
Dim xx, yy As Integer
Dim x1, y1, x2, y2 As Integer
Dim FrameLeft, FrameTop, FrameWidth, FrameHeight
' Save the FORM's properties so you can restore them when leaving the
' sub-routine.
'
SaveDrawWidth = DrawWidth
SaveFillStyle = FillStyle
SaveScaleMode = ScaleMode
DrawWidth = 1
FillStyle = 1
ScaleMode = 1
' Since the Windows scale default is twips and I haven't changed it, you
' have to find out the number of twips per pixel there are on your
' particular monitor.
'
TWIPS = screen.TwipsPerPixelX
Offset = FrameOffset * TWIPS
' Just as each control has its Left, Top, Width, and Height; you must
' find out those dimensions for the Frame.
FrameLeft = TopLeftControl.Left
FrameTop = TopLeftControl.Top
FrameWidth = BottomRightControl.Left + BottomRightCon